home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 248
/
248.d81
/
t.db+ doc 2
< prev
next >
Wrap
Text File
|
2022-08-26
|
17KB
|
665 lines
u
DOTBASIC PLUS
Part II
by Dave Moorman & Lee Novak
POSITION MOUSE
--------------
Include .PUTM
.PUTM,X,Y
Use this command to place the
mouse at any cellular X,Y location. If
you attempt to place the mouse outside
of its "cage", it will be snapped back
inside instantly.
PAUSE
-----
Include: .PAUSE
.PAUSE,jiffies
This routine waits for the
specified number of jiffy interrupts
to pass before returning control to
you. The wait is (usually) measured in
sixtieths of a second, and the value
cannot exceed 255.
PRINT CENTER
------------
Include .PC
.PC,Y,STRING
This routine prints your string
(up to 40 characters) centered on any
line Y (0-24). Don't use F7's in these
strings as you probably won't get the
effect you were looking for.
BOX
---
Include: .BOX
.BOX,X,Y,W,H,SC,CO
The BOX command is able to perform
a variety of tasks, based on the
parameters you feed it. The last two
parameters specify what to do within
the boundaries:
FULL: To fill an area with a
character, just specify its SCreen
code (0-254) and the COlor you want it
to be (0-15).
PAINT: Using 255 for a screen
code causes the routine to only color
the area, leaving screen RAM intact.
SHADE: Using 255 for a color code
causes all of the colors in the area
to be assigned a darker shade than
each currently has. Screen RAM is not
affected.
REVERSE, UN-REVERSE, and FLIP:
Add 128 to the color code to invoke
reverse, 64 for un-reverse, and 192
for flip. Color RAM will not be
affected unless you add an additional
16 to the values above.
FRAME: Adding 32 to the color
code will draw a frame (like BLOCK
below) that ignores the center area
automatically.
BLOCK: Adding 16 to the color
code results in a box made up of nine
specific characters. The defaults work
well with either case font. They can
be changed for use with custom fonts
that have their box-making characters
elsewhere.
BLOCK refuses to use screen code
0 in what it draws. This is so you can
set MV+41 (the screen code used to
draw the interior of boxes) to zero.
The effect is that BLOCK now behaves
like FRAME, leaving the center alone.
AFFECT REGION
-------------
Include: .AREG
.AREG,Region#,SC,CO
This command is just like BOX, but
instead of specifying the X,Y,W,H
parameters, you indicate which defined
region (using .DREG) you want to
affect.
AFFECT is most often used in
causing visible changes to a region
when it is clicked on. It can also
help in setting up screens.
SCREEN STASH
SCREEN RESTORE
--------------
Include: .STASH,.RESTR
.STASH,PAGE
.RESTR,PAGE
SCREEN STASH will store the text
screen and color map anywhere in
memory, even under I/O. 8 consecutive
pages (2048 bytes or 2K) are needed to
save screen and color. The border and
background colors are also saved. We
use page 208 and page 216 extensively.
SCREEN RESTORE displays a stashed
screen from anywhere in memory. The
border and background colors are also
restored.
Technical note: The stash/restore
routines copy 1002 bytes each of the
screen and color map. STASH will put
the border and background colors into
locations $d800+1000 and $d800+1001
before doing the memory transfer.
After RESTOREing, the colors are
brought back from those locations.
The two bytes after the end of the
screen are stashed and restored also,
but they have no significance.
CUT
PASTE
-----
Include: .CUT,.PASTE
.CUT,X,Y,W,H,LOC
.PASTE,X,Y,W,H,LOC
CUT and PASTE are able to stash
and restore any size portion of the
screen to or from any location, even
under I/O.
The data is stored sequentially in
memory with each cell's screen code
and color code stored one after
another. This formula reveals how much
memory is consumed by CUT:
bytes = W * H * 2
PASTE requires that you specify
the area to be filled. As long as you
use the same Width and Height as the
cut data, you can PASTE it wherever
you want, oodles of times. However, no
part of the area can be off-screen.
LET GO
------
Include: .LG
.LG
This command will wait until the
user is not holding either of the
mouse buttons (or their equivalents)
down, even if it takes all day.
100 .DO:.MA:.BG,X
110 X=(X+1)AND15:.LG
120 .UN L2%
COPYMEM
-------
Include: .CPYMEM
.CPYMEM,START,END+1,DESTINATION
SWAP MEM
Include: .SWPMEM
.SWPMEM,START,END+1,DESTINATION
COPY I/O INTACT
Include: .CPYIO
.CPYIO,START,END+1,DESTINATION
COPY CHR EXPOSED
Include: .CPYCHR
.CPYCHR,START,END+1,DESTINATION
COPY MEM is the classic command.
All ROMS are lifted and a raw memory
transfer is performed. The speed:
approximately 28 cycles per byte. If
the DESTinaton lies somewhere between
the START and END, a backwards copy is
performed to prevent corruption.
SWAP MEM will swap the area of
memory with that at the destination,
at a rate of 41 cycles per byte.
(Having the destination between the
start and end is NOT a good idea with
.SWPMEM!)
COPY I/O INTACT will lift the
ROMS, but leave the $d000 area alone.
This would be useful in copying the
color RAM or the VIC-chip's settings.
COPY CHAR EXPOSED will lift the
ROMS, but expose the Character-ROM in
the $d000 area so you can copy it.
REGULAR MENU
------------
Include: .MENU
.MENU,X,Y,W,I,U,Hi,HOT$
This command creates a highlight
bar that moves in sync with the mouse
pointer, until a selection is made.
When an item is clicked on, SL% will
return that "selection" number, which
will be anywhere from 1 to 25.
I is the number of items in the
menu (same as Height on other area-
covering commands).
U is the color of unhighlighted
items in the menu. The highlight bar
is colored H. If you do not want the
text to reverse or un-reverse as the
bar moves, add 128 to H.
You can use the CRSR/RETURN keys
instead of a mouse or joystick. In
order to provide a more natural menu
interface, the "Keyboard Enable"
variable at MV+20 is temporarily
zeroed during menus. The CRSR keys are
then read manually to move the
highlight bar, one move per press,
like we're all used to.
The HOTKEY string allows direct
selection of menu items. For example,
if you have hotkeys of "loadst*r", and
the user presses "d", the fourth item
is selected and the highlight bar is
moved there. If there was no such
item, SL% still returns a 4 but the
highlight bar would not change.
MENUS can have "regions active"
without the need to POKE to MV+10 or
MV+11. Clicking on an active region
from a menu will return the region
number (plus 128) in SL%. The HOTKEYS
would return "region-like" values.
The H+64 feature of menus will
only work if "honor hotkey colors" is
enabled. A HOTKEY COLOR is just ANY
color within the text of a menu which
is neither the highlight nor
un-highlight color. That leaves you
with 14 colors to make your menu's
hotkeys stand out, and stay that way.
Related Variables: (& defaults)
MV+10 Menu Type (192)
MV+12 Global Escape (0)
MV+12 holds the ASCII code for
what you'd like to designate as the
escape key for ALL your menus. SL%
returns a zero when the escape key is
pressed, except in one instance...
MV+10 dictates how your regular
menus will behave. Each bit stands for
a specific menu feature. Just add up
the values for the features you want
and POKE that number to MV+10.
+128 Automatic Caging of Mouse
+ 64 Automatic Point-to-First
+ 32 Must Select
+ 16 Escape Equal-to-Last
+ 8 Honor Hotkey Colors
+ 4 Dual Response
+ 2 Un-highlight after Select
+ 1 Stray-to-Exit
+128 causes the mouse to be
confined within the menu's borders.
After a selection is made, the
previous cage is restored. If
auto-caging is not enabled, the user
may be able to click on the area
outside of the menu, which would
return zero in SL% (unless it is an
active region).
+64 causes the mouse to be put at
the rightmost cell of the first item
the instant a regular menu is called.
+32 causes nothing to happen if
the user clicks on the area outside of
the menu. The menu remain